﻿using System.Xml.Schema;

namespace CategoryExample
{
    public struct Category
    {
        private int _categoryId;
        private string _categoryName;

        public Category(int categoryId, string categoryName)
        {
            _categoryId = categoryId;
            _categoryName = categoryName;
        }

        public int CategoryId
        {
            set
            {
                if (value >= 1 && value <= 100)
                {
                    _categoryId = value;
                }
            }
            get { return _categoryId; }
        }

        public string CategoryName
        {
            set
            {
                if (_categoryName.Length <= 40)
                {
                    _categoryName = value;
                }
            }
            get { return _categoryName; }
        }
    }
}